USE [master]
GO


/****** Object:  Database [Deploy]    Script Date: 10/08/2008 21:23:25 ******/

/** Drop database if exist and close any existing connections **/
IF  (EXISTS (SELECT name FROM sys.databases WHERE name = N'$(DBNAME)'))
BEGIN
  EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'$(DBNAME)'
  ALTER DATABASE [$(DBNAME)] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
  DROP DATABASE [$(DBNAME)]
END
GO

USE [master]
GO

/****** Object:  Database [Deploy]    Script Date: 10/08/2008 21:23:25 ******/
CREATE DATABASE [$(DBNAME)] ON  PRIMARY 
( NAME = N'$(DBNAME)', FILENAME = N'$(DBHOME)\$(DBNAME).mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'$(DBNAME)_log', FILENAME = N'$(DBHOME)\$(DBNAME)_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [$(DBNAME)] SET COMPATIBILITY_LEVEL = 100
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [$(DBNAME)].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE [$(DBNAME)] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [$(DBNAME)] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [$(DBNAME)] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [$(DBNAME)] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [$(DBNAME)] SET ARITHABORT OFF 
GO

ALTER DATABASE [$(DBNAME)] SET AUTO_CLOSE OFF 
GO

ALTER DATABASE [$(DBNAME)] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [$(DBNAME)] SET AUTO_SHRINK OFF 
GO

ALTER DATABASE [$(DBNAME)] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [$(DBNAME)] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [$(DBNAME)] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [$(DBNAME)] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [$(DBNAME)] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [$(DBNAME)] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [$(DBNAME)] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [$(DBNAME)] SET  DISABLE_BROKER 
GO

ALTER DATABASE [$(DBNAME)] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [$(DBNAME)] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [$(DBNAME)] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [$(DBNAME)] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [$(DBNAME)] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [$(DBNAME)] SET READ_COMMITTED_SNAPSHOT OFF 
GO

ALTER DATABASE [$(DBNAME)] SET HONOR_BROKER_PRIORITY OFF 
GO

ALTER DATABASE [$(DBNAME)] SET  READ_WRITE 
GO

ALTER DATABASE [$(DBNAME)] SET RECOVERY FULL 
GO

ALTER DATABASE [$(DBNAME)] SET  MULTI_USER 
GO

ALTER DATABASE [$(DBNAME)] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [$(DBNAME)] SET DB_CHAINING OFF 
GO


